import request from '@/utils/request'


// 查询商机简介
export function listBusiness(query) {
  return request({
    url: '/tienchin/business/list',
    method: 'get',
    params:query
  })
}
// 查询所有渠道
export function listChannels(query) {
  return request({
    url: '/tienchin/business/channels',
    method: 'get'
  })
}
//获取所以课程
export function getAllCourse(){
  return request({
    url:'/tienchin/business/all_course',
    method:'get'
  })
}
export function getUsersByDeptId(deptId){
  return request({
    url:'/tienchin/clue/users/' + deptId,
    method:'get'
  })
}

// 根据渠道id，查询活动
export function listActivityByChannelId(channelId) {
  return request({
    url: '/tienchin/business/activity/' + channelId,
    method: 'get'
  })
}
// 查询商机信息
export function getBusinessById(businessId) {
  return request({
    url: '/tienchin/business/' + businessId,
    method: 'get'
  })
}
// 根据课程类型 获取课程信息
export function getCourseByCourseType(type) {
  return request({
    url: '/tienchin/business/course/' + type,
    method: 'get'
  })
}

// 新增线索
export function addBusiness(data) {
  return request({
    url: '/tienchin/business',
    method: 'post',
    data: data
  })
}
export function businessFollow(data){
  return request({
    url: '/tienchin/business/follow',
    method: 'post',
    data: data
  })
}
export function assignBusiness(data) {
  return request({
    url: '/tienchin/clue/assignment',
    method: 'post',
    data: data
  })
}
// 查询商机的跟进记录
export function getClueRecordByBusinessId(businessId) {
  return request({
    url: '/tienchin/follow/record/business/' + businessId,
    method: 'get'
  })
}
export function getBusinessSummaryById(businessId) {
  return request({
    url: '/tienchin/business/summary/' + businessId,
    method: 'get'
  })
}

// 修改角色
export function updateBusiness(data) {
  return request({
    url: '/tienchin/business',
    method: 'put',
    data: data
  })
}

// 删除角色
export function delBusiness(businessIds) {
  return request({
    url: '/tienchin/business/' + businessIds,
    method: 'delete'
  })
}









